package tech.lixinlei.collection.list.indexof;

import tech.lixinlei.collection.list.contains.bo.ListItem;
import tech.lixinlei.collection.list.indexof.bo.Student;

import java.util.ArrayList;
import java.util.List;

public class IndexOfDemo {

    public static void main(String[] args) {
        List<Student> lists = new ArrayList<>();
        Student s1 = new Student();
        s1.setId(1);
        s1.setName("leilei");
        lists.add(s1);

        Student s2 = new Student();
        s2.setId(2);
        s2.setName("fafa");
        lists.add(s2);

        Student s = new Student();
        s.setId(1);
        s.setName("leilei");

        System.out.println(lists.indexOf(s));
    }

}
